Synchronous portions of Integrated Circuits (IC's) require one or more clocks to sequence state changes and signal generation. An oscillator can generate one or more of these required clocks. An external crystal can be connected to an internal oscillator circuit to generate a very precise clock. However, external crystals are expensive, and two pins are required to connect to the external crystal. The entire oscillator can be external to the IC, but these tend to be even more expensive.
An internal oscillator may have a resistor and capacitor that create an RC time constant delay that sets the frequency of oscillation. No external crystals are needed. However, accuracy may be problematic due to variations in temperature, process, and circuit design.
The frequency of oscillation generated by an internal oscillator circuits may be variable or tunable. A variable resistor or a variable capacitor may be used for the RC time constant in the circuit. As the capacitance or resistance is increased, the RC time constant increases and the delay and oscillation period increase. The frequency thus decreases. Typically, the oscillator frequency is proportional to 1/RC. This frequency is also dependent on the supply voltage, temperature, and semiconductor manufacturing process.
FIG. 1 shows a prior-art oscillator. Current source 14 charges capacitor 16. Current source 14 may include a voltage-to-current converter that uses a resistance R when charging capacitor 16, providing a RC time constant. Once capacitor 16 is sufficiently charged, a high signal is detected on the non-inverting (+) input of comparator 12 compared to reference voltage VREF applied to the inverting (−) input of comparator 12. Then comparator 12 drives its output FOUT high, turning on transistor 18 and discharging capacitor 16. Once the voltage across capacitor 16 falls below VREF, comparator 12 toggles FOUT low, turning off transistor 18 and allowing the charging cycle to be repeated.
Capacitor 16 can be replaced with a variable capacitor. One common variable capacitor has many binary-weighted capacitors in parallel, each with a switch to connect or disconnect that particular binary-weighted capacitor. A binary code can be applied to the switches, producing a total capacitance that is a binary weight corresponding to the binary code currently applied to the switches.
FIG. 2 is a graph showing oscillator frequency as a function of the binary code applied to an array of switched binary-weighted capacitors. The binary code increases linearly in binary increments of one, such as 1, 2, 3, 4, 5, 6, 7, 8, 9, . . . 15, so the total capacitance also increases in increments of the smallest or unit capacitance C, such as C, 2C, 3C. 4C. 5C, 6C, . . . 15C. However, since the frequency is proportional to the reciprocal of capacitance, (1/RC), the output frequency decreases along the path of reciprocal curve 104. Although the total capacitance and the capacitor binary codes are increasing linearly, the frequency does not increase in a linear fashion such as shown by ideal linear line 102.
The tuning step or increments of frequency adjustment is not linear. Increasing the binary code by one, and adding one unit capacitance, produces a much larger decrease in frequency for low binary values on the left side of the graph, than for high binary values on the right side of the graph. Curve 104 is very steep on the left, producing large changes in frequency per unit capacitance change, but nearly flat on the right, producing very little change in frequency per unit capacitance change.
This non-linearity in frequency response is undesirable. Binary codes for desired frequencies can be pre-calculated and stored on-chip, but adjustments such as to compensate for temperature and process variations may require trial and error and repeated attempts and be difficult to compensate for.
Using other codes, such as gray code or thermometer code, would likewise have the limitation of binary increments or increments that are multiples of binary values. However, binary-weighted switched capacitor arrays are widely used today.
What is desired is a more uniform frequency-tuning step for a variable capacitor. An on-chip RC oscillator with a variable capacitor that is not purely binary weighted is desirable. An oscillator that is pre-compensated for the non-linear reciprocal relationship of capacitance to frequency is desirable.